package com.clkj.aimin.dao.topic;

import com.clkj.aimin.pojo.topic.TopicComments;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author yawang
 * @create 2024/04/03 09:41:47
 **/
@Repository
public interface TopicCommentsMapper extends Mapper<TopicComments> {

    @Select("select a.*,b.user_name,b.user_img from t_cl_topicComments a " +
            "left join t_cl_user b on a.user_id = b.user_id " +
            "where a.topic_id = #{topicId} " +
            "order by a.commonts_id desc ")
    List<TopicComments> listComments(@Param("topicId")Integer topicId);
}
